<?php

/*
Process Set Status (admin_status.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$set_username = strtolower(ereg_replace(" ", "", $set_username));

mysql_query("UPDATE members2 SET rank=$set_rank WHERE username = '$set_username' AND game = '$game'");
$findUser = fetch("SELECT id FROM members2 WHERE username = '$set_username' AND game = '$game'");

if ($set_rank == 0)
{
	mysql_query("DELETE FROM forum_replies2 WHERE author = '$findUser[id]' AND game = '$game'");
	mysql_query("DELETE FROM forum_subjects2 WHERE author = '$findUser[id]' AND game = '$game'");
}

$rank = array("Suspended", "Mute", "Under 13", "Police", "Moderator", "Staff", "Admin");

record("Changed Status", "$username changed $set_username's status to $rank[$set_rank]", $timestamp, $game, $userid);

header("Location: admin_set_status.php?game=$game&error=You+have+changed+their+rank+successfully.");

?>
